Skip to content

MON-4025: Add AlertmanagerMainConfig#2148

Merged
openshift-merge-bot[bot] merged 2 commits intoopenshift:masterfrom
marioferh:alertmanager_monitoring_api
Jul 16, 2025
Merged

MON-4025: Add AlertmanagerMainConfig#2148
openshift-merge-bot[bot] merged 2 commits intoopenshift:masterfrom
marioferh:alertmanager_monitoring_api

Conversation

@marioferh
Copy link
Copy Markdown
Contributor

Every component will be in a separated PR in order to improve review process

First PR: #1929
Related: Enhancements Proposal openshift/enhancements#1627

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Jan 15, 2025

Hello @marioferh! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci openshift-ci bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 15, 2025
@openshift-ci openshift-ci bot requested review from JoelSpeed and bparees January 15, 2025 14:55
@marioferh marioferh force-pushed the alertmanager_monitoring_api branch from c0d2965 to c35227f Compare January 15, 2025 15:21
@marioferh
Copy link
Copy Markdown
Contributor Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 15, 2025
Copy link
Copy Markdown
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of the comments are centered around godoc. I'd recommend looking at https://github.com/openshift/enhancements/blob/master/dev-guide/api-conventions.md#write-user-readable-documentation-in-godoc for more information on what makes a good godoc that is helpful to users.

Another thing that stood out was multiple fields related to pod spec configuration - you may want to group those into a separate struct to have a single field that clearly denotes that the sub-fields in that object map directly to pod spec fields.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 26, 2025
@marioferh marioferh force-pushed the alertmanager_monitoring_api branch 4 times, most recently from 450dd7b to a6d7bc9 Compare April 30, 2025 08:11
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 30, 2025
Copy link
Copy Markdown
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only got about halfway through the changes on this round, will circle back soon to review the rest.

@marioferh marioferh force-pushed the alertmanager_monitoring_api branch 2 times, most recently from e062ce8 to ee3b854 Compare May 6, 2025 10:38
@marioferh marioferh force-pushed the alertmanager_monitoring_api branch 2 times, most recently from b324126 to d9fba48 Compare May 7, 2025 11:34
Copy link
Copy Markdown
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another round of comments. Additionally, I would like to see tests added to ensure the API and validations you have are working as expected.


// AlertmanagerContainerResources defines simplified resource requirements for a container.
type AlertmanagerContainerResources struct {
// cpu defines the CPU resource limits and requests.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because not setting this could be harmful to the system, are there any defaults that we set on a users behalf?

//
// When omitted, this means the user has no opinion and the platform is left
// to choose reasonable defaults. These defaults are subject to change over time.
// The current default is `- operator: "Exists"` which means that all taints are tolerated.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that safe? Not even an API question, but, tolerating all taints is generally not something we would do for control plane components. There are many valid taints (uninitialized for the CCM, network not ready) that I would expect this pod not to tolerate

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me think about it

@marioferh
Copy link
Copy Markdown
Contributor Author

Continue tomorrow with last comments

@marioferh marioferh force-pushed the alertmanager_monitoring_api branch 3 times, most recently from d60f672 to b758adf Compare May 15, 2025 08:22
Copy link
Copy Markdown
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another round of comments.

I'd also like to see some integration tests put in place to flex your validations and user workflows. https://github.com/openshift/api?tab=readme-ov-file#defining-api-validation-tests

// This field is only effective when the user workload Alertmanager instance is not enabled.
// If the user workload monitoring Alertmanager is enabled, this field is ignored.
// Required: This field must be specified.
// Allowed values are Selectable and None
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well I did selectable and none instead of enable or disable, correct?

Sure. We generally discourage using Enable/Disable for terminology in favor of something more meaningful in the context of the API.

If None and "" semantically mean the same thing, there isn't really a reason to have the None enum value.

For example, if None literally meant no user-defined configurations are processed and "" meant that the platform had some default namespace(s) it looked at for user-defined configurations then those would be semantically different and warrant having different values.

Also, what does Selectable mean? Does this mean I, as a user, can choose which namespaces Alertmanager will look at for user-defined configs?

@marioferh
Copy link
Copy Markdown
Contributor Author

#2148 (comment)
fixed

Signed-off-by: Mario Fernandez <mariofer@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 14, 2025
@marioferh
Copy link
Copy Markdown
Contributor Author

/retest-required

1 similar comment
@marioferh
Copy link
Copy Markdown
Contributor Author

/retest-required

@JoelSpeed
Copy link
Copy Markdown
Contributor

/override ci/prow/verify-crd-schema

Only incorrectly identified newly required fields (they have optional parents)

@JoelSpeed
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 14, 2025
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Jul 14, 2025

@JoelSpeed: Overrode contexts on behalf of JoelSpeed: ci/prow/verify-crd-schema

Details

In response to this:

/override ci/prow/verify-crd-schema

Only incorrectly identified newly required fields (they have optional parents)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Jul 14, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed, marioferh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot
Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 674ad74 and 2 for PR HEAD bcc4fc1 in total

@marioferh
Copy link
Copy Markdown
Contributor Author

/retest-required

@openshift-ci-robot
Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 674ad74 and 2 for PR HEAD bcc4fc1 in total

@marioferh
Copy link
Copy Markdown
Contributor Author

/retest-required

1 similar comment
@marioferh
Copy link
Copy Markdown
Contributor Author

/retest-required

@openshift-ci-robot
Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 674ad74 and 2 for PR HEAD bcc4fc1 in total

@marioferh
Copy link
Copy Markdown
Contributor Author

/retest-required

@marioferh
Copy link
Copy Markdown
Contributor Author

/test e2e-gcp

@marioferh
Copy link
Copy Markdown
Contributor Author

/test okd-scos-e2e-aws-ovn

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Jul 15, 2025

@marioferh: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-images c35227f link true /test okd-scos-images

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci-robot
Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 674ad74 and 2 for PR HEAD bcc4fc1 in total

@marioferh
Copy link
Copy Markdown
Contributor Author

/test okd-scos-e2e-aws-ovn

1 similar comment
@marioferh
Copy link
Copy Markdown
Contributor Author

/test okd-scos-e2e-aws-ovn

@marioferh
Copy link
Copy Markdown
Contributor Author

/test minor-e2e-upgrade-minor

@JoelSpeed
Copy link
Copy Markdown
Contributor

Minor upgrade seems to be affected by https://issues.redhat.com/browse/TRT-2190

/override ci/prow/minor-e2e-upgrade-minor

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Jul 16, 2025

@JoelSpeed: Overrode contexts on behalf of JoelSpeed: ci/prow/minor-e2e-upgrade-minor

Details

In response to this:

Minor upgrade seems to be affected by https://issues.redhat.com/browse/TRT-2190

/override ci/prow/minor-e2e-upgrade-minor

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-merge-bot openshift-merge-bot bot merged commit e375905 into openshift:master Jul 16, 2025
25 of 26 checks passed
@marioferh
Copy link
Copy Markdown
Contributor Author

Minor upgrade seems to be affected by https://issues.redhat.com/browse/TRT-2190

/override ci/prow/minor-e2e-upgrade-minor

ty

@openshift-bot
Copy link
Copy Markdown

[ART PR BUILD NOTIFIER]

Distgit: ose-cluster-config-api
This PR has been included in build ose-cluster-config-api-container-v4.20.0-202507161450.p0.ge375905.assembly.stream.el9.
All builds following this will include this PR.

@marioferh marioferh changed the title Monitoring API: Add AlertmanagerMainConfig MON-4025: Add AlertmanagerMainConfig Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants